<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class Job extends Model
{
	
    protected $table = 'job';
    public $timestamps = true;
    protected $dateFormat = 'U';

    /**
     * 允许修改和批量插入的属性
     *
     * @var array
     */
    protected $fillable = [];

    /**
     * 不能被批量赋值的属性
     *
     * @var array
     */
    protected $guarded = [];

    /**
     * 查询结果时 被隐藏的属性
     *
     * @var array
     */
    protected $hidden = [
        'created_at','updated_at','is_hot'
    ];

    protected $casts = [
        'salary' => 'integer',
        'special'=>'array'
    ];

    public function getEducationAttribute($value)
    {
        return config('setting.education')[$value];
    }

    public function getExpressAttribute($value)
    {
        return config('setting.express')[$value];
    }

    public function company(){
        return $this->hasOne('App\Models\Company','id','companyid');
    }

}
